{extend name="ashippingguide/Public/base" /}
{block name="container"}
<script src="__STATIC__/layout/js/plugins/layer/laydate/laydate.js"></script>
<div class="page-heade">
    <h2 class="title_color text-center">导购人事日志</h2>
</div>
<form action="" class="form-inline" id="form1" method="post">
    <table class="table table-bordered bud_hei">
        <tr>
            <td class="text-right">职员姓名：</td>
            <td><input type="text" name="b.em_name" class="form-control" value="<?php if(isset($where['b_em_name'])) echo $where['b_em_name']; ?>"></td>
            <td class="text-right">部门：</td>
            <td><input type="text" name="d.de_name" class="form-control" value="<?php if(isset($where['d_de_name'])) echo $where['d_de_name']; ?>"></td>
            <td class="text-right">创建时间：</td>
            <td>
                <div class="form-group">
                    <input type="text" id="start" class="form-control layer-date" style="min-width:120px;width:120px;display: inline-block;" name="time" value="<?php if(isset($where['time'])) echo $where['time']; ?>">
                </div>
                <div class="form-group">
                    至
                </div>
                <div class="form-group">
                    <input type="text" class="form-control layer-date" style="min-width:120px;width:120px;display: inline-block;" id="end" name="end" value="<?php if(isset($where['end'])) echo $where['end']; ?>">
                </div>
            </td>
        </tr>
        <tr>
            <td class="text-right">内容关键字：</td>
            <td><input type="text" class="form-control" name="a.content" value="<?php if(isset($where['content'])) echo $where['content']; ?>"></td>
            <td colspan="4">
                <button class="btn-sm btn-info btn" type="submit">查询</button><span class="lr_5"></span><button class="btn-sm btn-info btn" type="reset" id="reset">清空查询条件</button>
            </td>
        </tr>
    </table>
<table class="table table-striped table-bordered table-hover bud_hei text-center" style="width: 100%;">
    <tr class="info">
        <td>No.</td>
        <td>部门</td>
        <td>姓名</td>
        <td>时间</td>
        <td>日志类型</td>
        <td>内容</td>
        <td>查看明细</td>
    </tr>
    {volist name="data" id="list"}
    <tr>
        <td>{$i}</td>
        <td>{$list.de_name}</td>
        <td>{$list.em_name}</td>
        <td>{$list.time}</td>
        <td>{$list.logType}</td>
        <td>{$list.content}</td>
        <td><a href="javascript:;" class="seedetail" onclick="info({$list.id})">查看</a></td>
    </tr>
    {/volist}
</table>
<h5 class="text-center" style="font-size: 13px;font-weight: 500">
    总共有{$count}条记录，第{$page}/{$maxpage}页,当前页<input id="page" name="pages" type="text" style="width: 40px" value="1"/>
    <button id="gopage">Go</button>&nbsp;&nbsp;<button
        id="fistpage" onclick="$('#form1').find('input').val('');">首页</button>&nbsp;&nbsp;
    每页显示
    <select id="pagesize" name="limts">
        <option value='10' selected>10条</option>
        <option value='15'>15条</option>
        <option value='20'>20条</option>
    </select>
    <script>
        $('#pagesize').val("{$limit}");
    </script>
</h5>
</form>
<div id="addlaborcontractDiv" class="ibox-content" style="display: none;">
    <form action="" class="form-inline">
        <table class="table table-bordered">
            <tr>
                <td style="width: 140px" class="text-center">修改人</td>
                <td id="em_name"></td>
            </tr>
            <tr>
                <td class="text-center">部门</td>
                <td id="de_name"></td>
            </tr>
            <tr>
                <td class="text-center">修改时间</td>
                <td id="time"></td>
            </tr>
            <tr>
                <td class="text-center">内容</td>
                <td id="content"></td>
            </tr>
            <tr>
                <td class="text-center">备注</td>
                <td id="des">无</td>
            </tr>
        </table>
    </form>
</div>
<script>

    $(document).ready(function () {
        $('#reset').on('click',function () {
            $("#form1 input").each(function(){
                $(this).val('');
            });
            $("#form1 select").each(function(){
                $(this).val('');
            });
            $('#form1').submit()
            return false
        })
    })
    //日期范围限制
    var start = {
        elem: '#start',
        format: 'YYYY/MM/DD hh:mm:ss',
        min: '1970-01-01 00:00:00',
        max: '2099-06-16 23:59:59', //最大日期
        istime: true,
        istoday: false,
        choose: function (datas) {
            end.min = datas; //开始日选好后，重置结束日的最小日期
            end.start = datas //将结束日的初始值设定为开始日
        }
    };
    var end = {
        elem: '#end',
        format: 'YYYY/MM/DD hh:mm:ss',
        min: '1970-01-01 00:00:00',
        max: '2099-06-16 23:59:59',
        istime: true,
        istoday: false,
        choose: function (datas) {
            start.max = datas; //结束日选好后，重置开始日的最大日期
        }
    };
    laydate(start);
    laydate(end);
    function info(id) {
        $.get('{:url("ashippingguide/guideuserloginfo")}',{id:id},function (e) {
            if(e.success){
                $('#em_name').text(e.data.em_name);
                $('#de_name').text(e.data.de_name);
                $('#time').text(e.data.time);
                $('#content').text(e.data.content);
                $('#des').text(e.data.des);
                layer.open({
                    type: 1,
                    title: '查看明细',
                    area: ['700px', '500px'],
                    fixed: false, //不固定
                    maxmin: true,
                    content: $('#addlaborcontractDiv')
                });
            }else{
                swal('',e.msg,'warning');
            }
        },'json');
    }
    // $(".seedetail").click(function(){
    //
    // })

</script>
{/block}
